package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.entity.GoodsWetPrice;
import com.mybatisflex.core.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface GoodsWetPriceService extends IService<GoodsWetPrice> {

    GoodsWetPrice getByGoodsIdAndGoodsTypeId(Long goodsId, Long goodsTypeId);

    List<GoodsWetPrice> getByGoodsTypeId(List<Long> goodsTypeIds);

    // 入库更新数量、金额、加权平均价
    boolean updateWetAvgPrice(Long id, Long goodsTypeId, int usableNum, double usablePrice, double wetAvgPrice);

    // 出库更新数量、金额
    boolean updateUsableNumAndUsablePrice(Long id, Long goodsTypeId, int usableNum, double usablePrice);

    Map<Long, GoodsWetPrice> mapByGoodsTypeIdIn(List<Long> goodsTypeIds);

}
